//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.restaurant.application.indexes.exchangegoodslist.support;

import com.google.common.collect.Lists;
import com.nebutown.commonunits.dataface.definitions.TimeInterval;
import com.nebutown.generation.Convert;
import com.nebutown.generation.PickableBean;
import java.util.List;

public class ExchangeSearch implements PickableBean {
    public static final String FN_PHONE = "phone";
    public static final String FN_NICKNAME = "nickName";
    public static final String FN_CUSTOMERID = "customerId";
    public static final String FN_TIME = "time";
    public static final String FN_PAGE = "page";
    public static final String FN_GOODSID = "goodsId";
    public static final List<String> FIELD_NAMES = Lists.newArrayList(new String[]{"phone", "nickName", "customerId", "time", "page", "goodsId"});
    private String phone;
    private String nickName;
    private String customerId;
    private TimeInterval time;
    private Long page;
    private String goodsId;

    public ExchangeSearch(String phone, String nickName, String customerId, TimeInterval time, Long page, String goodsId) {
        this.setPhone(phone);
        this.setNickName(nickName);
        this.setCustomerId(customerId);
        this.setTime(time);
        this.setPage(page);
        this.setGoodsId(goodsId);
    }

    public ExchangeSearch() {
    }

    public ExchangeSearch duplicate() {
        ExchangeSearch result = new ExchangeSearch();
        result.phone = this.phone;
        result.nickName = this.nickName;
        result.customerId = this.customerId;
        result.time = this.time == null ? null : this.time.duplicate();
        result.page = this.page;
        result.goodsId = this.goodsId;
        return result;
    }

    public String toString() {
        return Convert.toJson(this);
    }

    public String getPhone() {
        return this.phone;
    }

    public void setPhone(String value) {
        this.phone = value;
    }

    public ExchangeSearch withPhone(String value) {
        this.setPhone(value);
        return this;
    }

    public ExchangeSearch withPhone(String value, String defaultValue) {
        this.setPhone(value == null ? defaultValue : value);
        return this;
    }

    public String getNickName() {
        return this.nickName;
    }

    public void setNickName(String value) {
        this.nickName = value;
    }

    public ExchangeSearch withNickName(String value) {
        this.setNickName(value);
        return this;
    }

    public ExchangeSearch withNickName(String value, String defaultValue) {
        this.setNickName(value == null ? defaultValue : value);
        return this;
    }

    public String getCustomerId() {
        return this.customerId;
    }

    public void setCustomerId(String value) {
        this.customerId = value;
    }

    public ExchangeSearch withCustomerId(String value) {
        this.setCustomerId(value);
        return this;
    }

    public ExchangeSearch withCustomerId(String value, String defaultValue) {
        this.setCustomerId(value == null ? defaultValue : value);
        return this;
    }

    public TimeInterval getTime() {
        return this.time;
    }

    public void setTime(TimeInterval value) {
        this.time = value;
    }

    public ExchangeSearch withTime(TimeInterval value) {
        this.setTime(value);
        return this;
    }

    public ExchangeSearch withTime(TimeInterval value, TimeInterval defaultValue) {
        this.setTime(value == null ? defaultValue : value);
        return this;
    }

    public Long getPage() {
        return this.page;
    }

    public void setPage(Long value) {
        this.page = value;
    }

    public ExchangeSearch withPage(Long value) {
        this.setPage(value);
        return this;
    }

    public ExchangeSearch withPage(Long value, Long defaultValue) {
        this.setPage(value == null ? defaultValue : value);
        return this;
    }

    public String getGoodsId() {
        return this.goodsId;
    }

    public void setGoodsId(String value) {
        this.goodsId = value;
    }

    public ExchangeSearch withGoodsId(String value) {
        this.setGoodsId(value);
        return this;
    }

    public ExchangeSearch withGoodsId(String value, String defaultValue) {
        this.setGoodsId(value == null ? defaultValue : value);
        return this;
    }

    public Object getValueOf(String name) {
        byte var3 = -1;
        switch(name.hashCode()) {
            case -1581184615:
                if (name.equals("customerId")) {
                    var3 = 2;
                }
                break;
            case 3433103:
                if (name.equals("page")) {
                    var3 = 4;
                }
                break;
            case 3560141:
                if (name.equals("time")) {
                    var3 = 3;
                }
                break;
            case 69737614:
                if (name.equals("nickName")) {
                    var3 = 1;
                }
                break;
            case 106642798:
                if (name.equals("phone")) {
                    var3 = 0;
                }
                break;
            case 207037201:
                if (name.equals("goodsId")) {
                    var3 = 5;
                }
        }

        switch(var3) {
            case 0:
                return this.getPhone();
            case 1:
                return this.getNickName();
            case 2:
                return this.getCustomerId();
            case 3:
                return this.getTime();
            case 4:
                return this.getPage();
            case 5:
                return this.getGoodsId();
            default:
                return null;
        }
    }

    public void setValueOf(String name, Object value) {
        byte var4 = -1;
        switch(name.hashCode()) {
            case -1581184615:
                if (name.equals("customerId")) {
                    var4 = 2;
                }
                break;
            case 3433103:
                if (name.equals("page")) {
                    var4 = 4;
                }
                break;
            case 3560141:
                if (name.equals("time")) {
                    var4 = 3;
                }
                break;
            case 69737614:
                if (name.equals("nickName")) {
                    var4 = 1;
                }
                break;
            case 106642798:
                if (name.equals("phone")) {
                    var4 = 0;
                }
                break;
            case 207037201:
                if (name.equals("goodsId")) {
                    var4 = 5;
                }
        }

        switch(var4) {
            case 0:
                this.setPhone((String)value);
                return;
            case 1:
                this.setNickName((String)value);
                return;
            case 2:
                this.setCustomerId((String)value);
                return;
            case 3:
                this.setTime((TimeInterval)value);
                return;
            case 4:
                this.setPage((Long)value);
                return;
            case 5:
                this.setGoodsId((String)value);
                return;
            default:
        }
    }

    public boolean hasField(String name) {
        return FIELD_NAMES.contains(name);
    }

    public int hashCode() {
        return this.signature().hashCode();
    }

    public boolean equals(Object o) {
        return !(o instanceof ExchangeSearch) ? false : this.signature().equals(((ExchangeSearch)o).signature());
    }

    public String signature() {
        throw new RuntimeException("Bean ExchangeSearch has no signature defined, no hash code or equals possible.");
    }
}
